package com.gbanker.goldwallet.goldprice;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.TextView;

import com.squareup.okhttp.OkHttpClient;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    Button button;
    OkHttpClient mHttpClient = new OkHttpClient();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_main);

        TextView textview = (TextView)findViewById(R.id.priceText);
        textview.setText("287.88");

        button = (Button)findViewById(R.id.button_buy);
        button.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        switch (id){
            case R.id.button_buy:
                button.setText("我被点击了");
                gotGoldPrice();
                break;
        }
    }

    public void gotGoldPrice() {

    }
}
